"""添加日志页面"""
from selenium.webdriver.common.by  import By
from page.base_page import BasePage

class AddLogPage(BasePage):
    url='/crm5/index.php?m=log&a=mylog_add'
    title_text_locator = (By.CSS_SELECTOR,"body > div.container > div.row > div > form > table > tbody > tr:nth-child(2) > td:nth-child(2) > input")
    description_text_locator = (By.CSS_SELECTOR, "body > div.container > div.row > div > form > table > tbody > tr:nth-child(8) > td:nth-child(2) > div > div.ke-edit > iframe")
    btn_saves_locator = (By.CSS_SELECTOR,"body > div.container > div.row > div > form > table > tfoot > tr > td:nth-child(2) > input:nth-child(1)")
    category_id_locator = (By.NAME, "category_id")

    def title_text_clear(self):
        self.driver.find_element(*self.title_text_locator).clear()
    def input_title_text(self,title_text):
        self.driver.find_element(*self.title_text_locator).send_keys(title_text)
    def input_description_text(self,description_text):
        self.driver.find_element(*self.description_text_locator).send_keys(description_text)
    def click_btn_save(self):
        self.driver.find_element(*self.btn_saves_locator).click()
    def click_category_id(self):
        self.driver.find_element(*self.category_id_locator).click()

